package it.crosato.stage.server.model.phylogeny;

import static org.junit.Assert.*;

import java.awt.image.BufferedImage;
import java.util.Vector;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class PhylogeneticTreesBuilderTest {

	@Test
	public void testUPGMA() {
		Vector<String> organisms = new Vector<String>();
		organisms.add("hsa");
		organisms.add("pan");
		organisms.add("ano");
		double[][] dm = {
				{0, 0.5, 1},
				{0.5, 0, 0.8},
				{1, 0.8, 0}
		};
		BufferedImage upgma = PhylogeneticTreesBuilder.UPGMA(dm, organisms);
		assertTrue(upgma != null);
	}

	@Test
	public void testNJ() {
		Vector<String> organisms = new Vector<String>();
		organisms.add("hsa");
		organisms.add("pan");
		organisms.add("ano");
		double[][] dm = {
				{0, 0.5, 1},
				{0.5, 0, 0.8},
				{1, 0.8, 0}
		};
		BufferedImage nj = PhylogeneticTreesBuilder.NJ(dm, organisms);
		assertTrue(nj != null);
	}
	
	@Before
	public void setUp() {
		
	}
	
	@After
	public void tearDown() {
		
	}

}
